package main;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-03-08
 * Time: 18:26
 */
public class Test {

    public static void main(String[] args) {
        loop: while (true){
            switch (1){
                case 1:
                    break loop;
            }
        }
    }
    public static void main4(String[] args) {
        String str = "sddaef";
        char[] ch = str.toCharArray();
        for (int i = 0; i < ch.length; i++) {
            System.out.print(ch[i]+" ");
        }
        str = new String(ch);
        System.out.println(str);
    }
    public static void main3(String[] args) {
        int[] arr = {1,4,5,3,6,7,8,3};
        double ret = sum(arr);
        System.out.println(ret);

    }

    public static double sum(int[] arr){
        double sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        return sum/arr.length;
    }
    public static void main2(String[] args) {
        int[] arr = {1,2,3,4,5};
        print(arr);
        transform(arr);
        print(arr);

    }
    public static void transform(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            arr[i] *= 2;
        }
    }
    public static void print(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
        System.out.println();
    }
    public static void main1(String[] args) {
        int[] arr = new int[]{1,2,3,4,5,6,7,8,9,10};
        printArray(arr);
    }
    public static void printArray(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }
}
